package com.hjxr.quota.define.domain;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 指标来源表实体类
 * @author ma
 * @date 2020/9/14 - 16:09
 **/
@Data
@ApiModel
@TableName("QUOTA_SOURCE")
@KeySequence(value = "seq_quota_source", clazz = Integer.class)
public class QuotaSource implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增主键")
    @TableField("ID")
    private Integer id;

    @ApiModelProperty(value = "对应指标ID")
    @TableField("QUOTA_ID")
    private Integer quotaId;

    @ApiModelProperty(value = "指标来源类型.1：数据库；2：excel文件；3：csv文件；4：txt文件；5：其他")
    @TableField("S_TYPE")
    private String sType;

    @ApiModelProperty(value = "指标来源地址，文件为存储地址，数据库为jdbc数据库连接串；如： jdbc:oracle:thin:@localhost:1521:DataBaseName；jdbc:mysql://localhost:3306/DataBaseName")
    @TableField("ADDR")
    private String addr;

    @ApiModelProperty(value = "指标来源文件名，或者表名称")
    @TableField("S_TABLE")
    private String sTable;

    @ApiModelProperty(value = "指标数据源id，只针对数据库数据源")
    @TableField("DATASOURCE_ID")
    private Integer datasourceId;

    @ApiModelProperty(value = "指标所属列名，数据库为字段名")
    @TableField("S_COL")
    private String sCol;

    @ApiModelProperty(value = "指标所属行，只针对文本")
    @TableField("S_ROW")
    private String sRow;

    @ApiModelProperty(value = "指标生成SQL语句，只针对SQL方式创建的指标")
    @TableField("QSQL")
    private String qsql;

    @ApiModelProperty(value = "指标计算公式")
    @TableField("FORMULA")
    private String formula;

    @ApiModelProperty(value = "维度集合")
    @TableField("DIMENSIONS")
    private String dimensions;

    @ApiModelProperty(value = "创建人", hidden = true)
    @TableField(value = "CREATE_BY",fill = FieldFill.INSERT)
    private String createBy;

    @ApiModelProperty(value = "创建时间", hidden = true)
    @TableField(value ="CREATE_DATE",fill = FieldFill.INSERT)
    private Date createDate;

    @ApiModelProperty(value = "更新人", hidden = true)
    @TableField(value ="UPDATE_BY",fill = FieldFill.UPDATE)
    private String updateBy;

    @ApiModelProperty(value = "更新时间", hidden = true)
    @TableField(value ="UPDATE_DATE",fill = FieldFill.UPDATE)
    private Date updateDate;

    @ApiModelProperty(value = "数据表字段别名表ID")
    @TableField("COLNAME_ID")
    private Integer colnameId;


}
